<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateShopCamera extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_camera', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger("shopId")->index('idx_shopId')->default(0)->comment("店铺id");
            $table->unsignedTinyInteger("type")->default(0)->comment("摄像头类型 1客流相机 2普通相机");
//            $table->unsignedBigInteger("pid")->default(0)->comment("父类 ID");
            $table->unsignedTinyInteger("tripleType")->default(1)->comment("1 摄像头三元组 2NVR 三元组");
            $table->string("name", 50)->default('')->comment("摄像名称");
            $table->string("serialNo", 100)->default('')->comment("sn 产品序列号");
            $table->string("deviceName", 100)->default('')->comment("dn 码");
            $table->string("productKey", 100)->default('')->comment("pk 码");
            $table->string("deviceSecret", 100)->default('')->comment("ds 码");
            $table->string("mac", 100)->index('idx_mac')->default(0)->comment("mac 地址");
            $table->unsignedTinyInteger("status")->default(0)->comment("摄像头状态 0 未激活 1 在线 2 离线");

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('更新时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('更新人');
            $table->tinyInteger("isDeleted")->default(0)->comment("是否删除,0:未删除,1:已删除");

            $table->comment = '门店摄像头配置';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shop_camera');
    }
}
